using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class Table2dStoryDao:DaoBase<Table2dStory>
    {
        public override void AddPrimaryIndex(Table2dStory model)
        {
            cachePrimary[model.Story2dId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "Table2dStory.txt";
        }

        protected override Table2dStory ParseRowData(string[] rowData)
        {
            Table2dStory data = new Table2dStory();
			data.Story2dId = rowData [0];
			data.StoryResourceName = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.StoryDuration = 0;
            }
            else
            {
                data.StoryDuration = double.Parse(rowData[2]);
            }
			data.StoryMusic = rowData [3];
			data.StorySound = rowData [4];
			data.StorySubtitle = rowData [5];

            return data;
        }



    }

}
